# database.py
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

# 数据库连接字符串（SQLite 示例）
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:021008@localhost/work"


# 创建数据库引擎
engine = create_engine(
    SQLALCHEMY_DATABASE_URL,

)

# 创建会话工厂
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

# 声明基类（用于定义模型）
Base = declarative_base()